[skip changelog] Only download required artifact in Windows Installer job of release workflows #2743
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Please check if the PR fulfills these requirements
See how to contribute
before creating one)
our contributing guidelines
UPGRADING.md
has been updated with a migration guide (for breaking changes)configuration.schema.json
updated if new parameters are added.What kind of change does this PR introduce?
Bug fix
What is the current behavior?
The project's nightly build and production release workflows generate a Windows Installer package of Arduino CLI. This is generated from the Windows x86-64 build, which is produced by a prior job. The builds are transferred between jobs by GitHub Actions workflow artifacts, one for each host architecture.
The
create-windows-installer
job that generates the Windows Installer package unnecessarily downloads all the build artifacts:arduino-cli/.github/workflows/publish-go-nightly-task.yml
Line 204 in 7ee4cf7
arduino-cli/.github/workflows/release-go-task.yml
Line 204 in 7ee4cf7
This, even though it only requires the Windows x86-64 artifact. In addition to being inefficient, this was problematic because the
create-windows-installer
job is running in parallel with thenotarize-macos
job, which modifies the macOS artifacts. In order to fix a bug in the workflow, thenotarize-macos
job was recently changed (#2732) to delete the non-notarized macOS artifacts after downloading them so that the job could replace those artifacts with the notarized builds:arduino-cli/.github/workflows/publish-go-nightly-task.yml
Lines 102 to 105 in 7ee4cf7
arduino-cli/.github/workflows/release-go-task.yml
Lines 102 to 105 in 7ee4cf7
This caused the
create-windows-installer
job's download of the macOS artifacts to fail when it attempted to download them after the time the parallelnotarize-macos
job had deleted them (but before thenotarize-macos
job had uploaded the artifacts again):https://github.com/arduino/arduino-cli/actions/runs/11647407075/job/32432652767#step:3:56
What is the new behavior?
The proposed solution is to configure the
create-windows-installer
job to only download the artifact it requires. This artifact is not modified by any parallel job so there is no danger of a conflict.Does this PR introduce a breaking change, and is titled accordingly?
No breaking change.
Other information
In order to facilitate the review, I modified the workflows so that they would not publish a release (historically I would have performed a full release in my own fork to demonstrate such a proposal, but the workflows are now utterly hostile to testing by contributors due to the new Windows signing certificate system) and triggered a run of each:
"Publish Nightly Build" workflow
https://github.com/arduino/arduino-cli/actions/runs/11648945583
The generated Windows Installer artifact can be downloaded from the "Artifacts" section of the page.
"Release" workflow
https://github.com/arduino/arduino-cli/actions/runs/11648942575
In this run, the Windows Installer generation step failed spuriously due to the workflow not having been triggered by a tag as intended (I didn't want to push a tag to Arduino's repo so I configured the workflow to be triggered by the
push
event instead):https://github.com/arduino/arduino-cli/actions/runs/11648942575/job/32435926970#step:5:37
However, you can see that the previously failing "Download artifacts" is now successful:
https://github.com/arduino/arduino-cli/actions/runs/11648942575/job/32435926970#step:3:1